1. Field of the Invention
The present disclosure relates generally to code generation, and more specifically to hardware description language (HDL) code generation.
2. Background Information
The use of HDLs to describe electronic hardware has become increasingly widespread. An HDL is a language that includes expressions for describing the temporal behavior, as well as the spatial structure (e.g., circuit connectivity) of hardware. In contrast to most “software” programming languages, such as C, C++, Java and others, an HDL's syntax and semantics generally includes explicit notations for expressing time and concurrency, as they are often important attributes of hardware devices.
Popular HDLs include Verilog, which was originally introduced by Gateway Design Automation and has been most recently standardized under IEEE Std. 1800-2005 and Very High Speed Integrated Circuit Hardware (VHSIC) Description Language (VHDL) most recently standardized under IEEE Std. 1076-2000. In addition, other popular languages, such as SystemVerilog standardized under IEEE Std. 1800-2005 and a synthesizable subset of SystemC, most recently standardized under IEEE Std. 1666-2005, implement HDL-like functionality and may in a general sense be considered HDLs. HDL code may be structured at a number of different levels. Commonly, HDL code is structured at the Register Transfer Level (RTL), a level that combines behavioral and dataflow constructs to describe a hardware device. RTL HDL code may be used to define modules. The modules may then be provided to a synthesis tool and synthesized into a gate-level netlist, which is a description of a circuit in terms of logic gates and the connections between gates. The gate-level netlist may then be provided to an automated place-and-route routine that creates a layout for the hardware device. Such a layout may be used to create an application specific integrated circuit (ASIC), or to configure a field programmable gate array (FPGA) or Programmable Array Logic (PAL), or to implement and/or configure another type of hardware device.
Although HDLs provide a proven technique for hardware design, the task of specifying hardware with an HDL is generally difficult and labor intensive. As such, the mechanics of low-level HDL coding often consumes a significant amount of development time.
In part to relieve a designer from the burdens of manual HDL coding, some computing environments allow a designer to write code in a higher level text or graphical programming language, and then generate HDL modules there from. For example, the MATLAB® technical computing environment (TCE) available from The MathWorks, Inc. of Natick, Mass. allows a designer to describe the functionality of certain hardware devices, for example digital filters, and to automatically generate HDL modules, such as Verilog and/or VHDL modules, therefrom. The MATLAB® TCE further may be used to generate appropriate test benches for simulating, testing, and verifying the generated HDL modules.
A Simulink® TCE, also available from The Mathworks, Inc., and includes functionality that allows the designer to build a model using graphical programming techniques, for example by dragging and dropping blocks from a library into a graphical editor and connecting them with lines that establish relationships between the blocks. Thereafter, the designer may automatically generate HDL modules, such as Verilog and/or VHDL modules therefrom. Similarly, test benches for use with the generated HDL modules may also be generated. In this manner, low-level manual HDL coding may often be avoided.
In some circumstance, the full advantages of automatic HDL code generation may not be fully realized, as one must still modify and/or add to the generated HDL code to ensure certain features are implemented in a desired manner. For example, an issue often occurs when numerical parameters are implemented in a design. Often such numerical parameters are automatically “hard-coded” into the generated HDL modules. That is, the numerical parameters are simply defined in the HDL code using a data type associated with constants, such as the parameter or localparameter constructs in Verilog, or the constant construct in VHDL. Hard-coding parameters may lead to simple and efficient hardware, yet provide little flexibility for later adjustments and dynamic changes to the numerical parameters.
Sometimes a designer may desire for certain numerical parameters to not be hard-coded into HDL modules. This may require a designer to delve into the HDL code, and manually code additional features needed to implement such a design. The need for manual HDL coding requires the designer to be proficient in HDL programming. In addition, the need for manual HDL coding may consume significant development time.
Accordingly, improved techniques are needed.